package error

type BusstionError struct {
	Code int
	Msg  string
	Err  error
}

type Code struct {
	Code int
	Msg  string
}

var (
	Ok                         = Code{Code: 200, Msg: "success"}
	ServerException            = Code{Code: 500, Msg: "fail"}
	UpdateException            = Code{Code: 1000000, Msg: "update fail"}
	SelectException            = Code{Code: 1000001, Msg: "select fail"}
	DeleteException            = Code{Code: 1000002, Msg: "delete fail"}
	InsertException            = Code{Code: 1000003, Msg: "insert fail"}
	ParamException             = Code{Code: 1000004, Msg: "param error"}
	UserStatusDisableException = Code{Code: 1000005, Msg: "账户已经停用，请联系管理员"}
)

func Success() BusstionError {
	return BusstionError{
		Code: Ok.Code,
		Msg:  Ok.Msg,
		Err:  nil,
	}

}
